﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace iChip.Hotspots.Models
{
    public class Fields
    {
    }

    public class Field
    {
        public Field()
        {
            //Field_Type = new List<SelectListItem>();            
        }

        public int Field_Id { get; set; }
        public string Field_Name { get; set; }
        public int FieldType_Id { get; set; }
        public bool Field_IsRequire { get; set; }
             
    }

    public class FieldValue
    {
        public FieldValue()
        {

        }
        public int FieldValue_Id { get; set; }
        public int Field_Id { get; set; }
        public string Field_Name { get; set; }
        public string FieldValue_Value { get; set; }
    }

    public class FieldCreate
    {
        public FieldCreate()
        {

        }
        public string Field_Name { get; set; }
        public string Field_Type { get; set; }
        public bool Field_IsMulti { get; set; }
    }

    public class FieldModel
    {
        public FieldModel()
        {
            Fields = new List<Field>();
            Methods = new List<Method>();
            Field_Type = new List<SelectListItem>();
        }

        public List<Method> Methods { get; set; }
        public List<Field> Fields { get; set; }
        public bool HasSurvey
        {
            get
            {
                if (this.Methods == null)
                {
                    return false;
                }
                else
                {
                    if(this.Methods.Any(m=> m.Method_Type == Commons.Enums.MethodType.Survey.ToString()))
                    {
                        return true;
                    }
                    else
                    { return false; 
                    }
                }
            }
        }
        public IEnumerable<SelectListItem> Field_Type { get; set; }   
       
    }
}